package ar.edu.unq.wannaplay.dtos;

import java.util.Map;

import ar.edu.unq.wannaplay.ocupation.CareerPlan;
import ar.edu.unq.wannaplay.utils.Pair;

public class CareerPlanDTO extends DTO<CareerPlan> {

    private static final long serialVersionUID = 1L;

    private String name;

    private String oldName;

    private Map<String, Pair<Integer, Integer>> salaries;

    public CareerPlanDTO(final CareerPlan entity) {
        super();
        name = entity.getName();
        salaries = entity.getSalaries();
        oldName = name;
    }

    public void setName(final String name) {
        this.name = name;
    }

    public String getName() {
        return name;
    }

    public Map<String, Pair<Integer, Integer>> getSalaries() {
        return salaries;
    }

    @Override
    public CareerPlan fromDto() {
        CareerPlan careerPlan = new CareerPlan(this.getName());
        careerPlan.setSalaries(this.getSalaries());
        return careerPlan;
    }

    public void setOldName(final String oldName) {
        this.oldName = oldName;
    }

    public String getOldName() {
        return oldName;
    }

    public void setSalaries(final Map<String, Pair<Integer, Integer>> salaries) {
        this.salaries = salaries;
    }

}
